home *** CD-ROM | disk | FTP | other *** search
/ Canon Creative 3 / Canon Creative 3 - Disc 2.iso / designe / DE.DIR / 00001.ls next >
Encoding:
Text File  |  1997-05-08  |  17.8 KB  |  654 lines

  1. on clickButton
  2.   set sp to the clickOn
  3.   set cc to the castNum of sprite the clickOn
  4.   puppetSprite(sp, 1)
  5.   set the castNum of sprite sp to cc + 1
  6.   puppetSound("click")
  7.   updateStage()
  8.   set hilited to 1
  9.   repeat while the mouseDown
  10.     if hilited then
  11.       if the mouseCast <> (cc + 1) then
  12.         set the castNum of sprite sp to cc
  13.         set hilited to 0
  14.         updateStage()
  15.       end if
  16.       next repeat
  17.     end if
  18.     if the mouseCast = cc then
  19.       set the castNum of sprite sp to cc + 1
  20.       set hilited to 1
  21.       updateStage()
  22.     end if
  23.   end repeat
  24.   set the castNum of sprite sp to cc
  25.   updateStage()
  26.   return hilited
  27. end
  28.  
  29. on tabButton
  30.   set sp to the clickOn
  31.   set cc to the castNum of sprite the clickOn
  32.   puppetSprite(sp, 1)
  33.   set the castNum of sprite sp to cc + 1
  34.   puppetSound("tabDown")
  35.   updateStage()
  36.   set hilited to 1
  37.   repeat while the mouseDown
  38.     if hilited then
  39.       if the mouseCast <> (cc + 1) then
  40.         set the castNum of sprite sp to cc
  41.         set hilited to 0
  42.         updateStage()
  43.       end if
  44.       next repeat
  45.     end if
  46.     if the mouseCast = cc then
  47.       set the castNum of sprite sp to cc + 1
  48.       set hilited to 1
  49.       updateStage()
  50.     end if
  51.   end repeat
  52.   set the castNum of sprite sp to cc
  53.   updateStage()
  54.   puppetSprite(sp, 0)
  55.   return hilited
  56. end
  57.  
  58. on screenAreaButton
  59.   set sp to the clickOn
  60.   set cc to the castNum of sprite the clickOn
  61.   set hilited to 1
  62.   repeat while the mouseDown
  63.     if hilited then
  64.       if the mouseCast <> cc then
  65.         set hilited to 0
  66.         updateStage()
  67.       end if
  68.       next repeat
  69.     end if
  70.     if the mouseCast = cc then
  71.       set hilited to 1
  72.       updateStage()
  73.     end if
  74.   end repeat
  75.   if hilited then
  76.     puppetSound("screenButtonClick")
  77.     updateStage()
  78.   end if
  79.   return hilited
  80. end
  81.  
  82. on pushButton
  83.   set sp to the clickOn
  84.   set cc to the castNum of sprite the clickOn
  85.   puppetSprite(sp, 1)
  86.   set the castNum of sprite sp to cc + 1
  87.   puppetSound("pushButtonSound")
  88.   updateStage()
  89.   set hilited to 1
  90.   repeat while the mouseDown
  91.     if hilited then
  92.       if the mouseCast <> (cc + 1) then
  93.         set the castNum of sprite sp to cc
  94.         set hilited to 0
  95.         updateStage()
  96.       end if
  97.       next repeat
  98.     end if
  99.     if the mouseCast = cc then
  100.       set the castNum of sprite sp to cc + 1
  101.       set hilited to 1
  102.       updateStage()
  103.     end if
  104.   end repeat
  105.   updateStage()
  106.   puppetSprite(sp, 0)
  107.   return hilited
  108. end
  109.  
  110. on screenButton
  111.   set sp to the clickOn
  112.   set cc to the castNum of sprite the clickOn
  113.   puppetSprite(sp, 1)
  114.   set the castNum of sprite sp to cc + 1
  115.   puppetSound("screenButtonClick")
  116.   updateStage()
  117.   set hilited to 1
  118.   repeat while the mouseDown
  119.     if hilited then
  120.       if the mouseCast <> (cc + 1) then
  121.         set the castNum of sprite sp to cc
  122.         set hilited to 0
  123.         updateStage()
  124.       end if
  125.       next repeat
  126.     end if
  127.     if the mouseCast = cc then
  128.       set the castNum of sprite sp to cc + 1
  129.       set hilited to 1
  130.       updateStage()
  131.     end if
  132.   end repeat
  133.   set the castNum of sprite sp to cc
  134.   updateStage()
  135.   puppetSprite(sp, 0)
  136.   return hilited
  137. end
  138.  
  139. on checkRoll rolloverSpriteList
  140.   set nn to count(rolloverSpriteList)
  141.   repeat with i = 1 to nn
  142.     set sp to getAt(rolloverSpriteList, i)
  143.     set cc to the castNum of sprite sp
  144.     set cName to the name of cast cc
  145.     if rollOver(sp) then
  146.       if cName = "unRolled" then
  147.         puppetSprite(sp, 1)
  148.         if (sp >= 14) and (sp <= 21) then
  149.           puppetSound("tabRoll")
  150.         else
  151.           if (sp >= 7) and (sp <= 9) then
  152.             puppetSound("tabRoll")
  153.           else
  154.             puppetSound("note" & random(10))
  155.           end if
  156.         end if
  157.         set the castNum of sprite sp to the castNum of sprite sp + 1
  158.       end if
  159.       next repeat
  160.     end if
  161.     puppetSprite(sp, 0)
  162.   end repeat
  163.   updateStage()
  164. end
  165.  
  166. on checkRoll2 rolloverSpriteList
  167.   set nn to count(rolloverSpriteList)
  168.   repeat with i = 1 to nn
  169.     set sp to getAt(rolloverSpriteList, i)
  170.     set cc to the castNum of sprite sp
  171.     set cName to the name of cast cc
  172.     if rollOver(sp) then
  173.       if cName = "unRolled" then
  174.         puppetSprite(sp, 1)
  175.         if (sp >= 14) and (sp <= 21) then
  176.           puppetSound("tabRoll")
  177.         else
  178.           if (sp >= 7) and (sp <= 9) then
  179.             puppetSound("tabRoll")
  180.           else
  181.             puppetSound("note" & random(10))
  182.           end if
  183.         end if
  184.         set the castNum of sprite sp to the castNum of sprite sp + 1
  185.       end if
  186.       next repeat
  187.     end if
  188.     puppetSprite(sp, 0)
  189.   end repeat
  190.   updateStage()
  191. end
  192.  
  193. on checkQuitRoll rolloverSpriteList
  194.   set nn to count(rolloverSpriteList)
  195.   repeat with i = 1 to nn
  196.     set sp to getAt(rolloverSpriteList, i)
  197.     set cc to the castNum of sprite sp
  198.     set cName to the name of cast cc
  199.     if rollOver(sp) then
  200.       if cName = "unRolled" then
  201.         puppetSprite(sp, 1)
  202.         if (sp >= 14) and (sp <= 21) then
  203.           puppetSound("tabRoll")
  204.         else
  205.           if (sp >= 6) and (sp <= 9) then
  206.             puppetSound("tabRoll")
  207.           else
  208.             puppetSound("note" & random(10))
  209.           end if
  210.         end if
  211.         set the castNum of sprite sp to the castNum of sprite sp + 1
  212.       end if
  213.       next repeat
  214.     end if
  215.     puppetSprite(sp, 0)
  216.   end repeat
  217.   updateStage()
  218. end
  219.  
  220. on checkAddonSectionRoll rolloverSpriteList
  221.   set nn to count(rolloverSpriteList)
  222.   repeat with i = 1 to nn
  223.     set sp to getAt(rolloverSpriteList, i)
  224.     set cc to the castNum of sprite sp
  225.     set cName to the name of cast cc
  226.     if rollOver(sp) then
  227.       if cName = "unRolled" then
  228.         puppetSprite(sp, 1)
  229.         if ((sp >= 14) and (sp <= 21)) or ((sp >= 7) and (sp <= 9)) then
  230.           puppetSound("tabRoll")
  231.         else
  232.           if (sp >= 7) and (sp <= 9) then
  233.             puppetSound("tabRoll")
  234.           else
  235.             puppetSound("newNote" & random(9))
  236.           end if
  237.         end if
  238.         set the castNum of sprite sp to the castNum of sprite sp + 1
  239.       end if
  240.       next repeat
  241.     end if
  242.     puppetSprite(sp, 0)
  243.   end repeat
  244.   updateStage()
  245. end
  246.  
  247. on checkIntroRoll rolloverSpriteList
  248.   set nn to count(rolloverSpriteList)
  249.   repeat with i = 1 to nn
  250.     set sp to getAt(rolloverSpriteList, i)
  251.     set cc to the castNum of sprite sp
  252.     set cName to the name of cast cc
  253.     if rollOver(sp) then
  254.       if cName = "unRolled" then
  255.         puppetSprite(sp, 1)
  256.         if sp = 11 then
  257.           puppetSound("keyJangle")
  258.         else
  259.           if (sp >= 14) and (sp <= 21) then
  260.             puppetSound("tabRoll")
  261.           else
  262.             if (sp >= 7) and (sp <= 9) then
  263.               puppetSound("tabRoll")
  264.             else
  265.               puppetSound("note" & random(10))
  266.             end if
  267.           end if
  268.         end if
  269.         set the castNum of sprite sp to the castNum of sprite sp + 1
  270.       end if
  271.       next repeat
  272.     end if
  273.     puppetSprite(sp, 0)
  274.   end repeat
  275.   updateStage()
  276. end
  277.  
  278. on checkTourRoll rolloverSpriteList
  279.   set nn to count(rolloverSpriteList)
  280.   repeat with i = 1 to nn
  281.     set sp to getAt(rolloverSpriteList, i)
  282.     set cc to the castNum of sprite sp
  283.     set cName to the name of cast cc
  284.     if rollOver(sp) then
  285.       if cName = "unRolled" then
  286.         puppetSprite(sp, 1)
  287.         if sp = 11 then
  288.           puppetSound("unlockDoor")
  289.         else
  290.           if (sp >= 14) and (sp <= 21) then
  291.             puppetSound("tabRoll")
  292.           else
  293.             if (sp >= 7) and (sp <= 9) then
  294.               puppetSound("tabRoll")
  295.             else
  296.               puppetSound("tabRoll")
  297.             end if
  298.           end if
  299.         end if
  300.         set the castNum of sprite sp to the castNum of sprite sp + 1
  301.       end if
  302.       next repeat
  303.     end if
  304.     puppetSprite(sp, 0)
  305.   end repeat
  306.   updateStage()
  307. end
  308.  
  309. on checkSamplesRoll rolloverSpriteList
  310.   set nn to count(rolloverSpriteList)
  311.   repeat with i = 1 to nn
  312.     set sp to getAt(rolloverSpriteList, i)
  313.     set cc to the castNum of sprite sp
  314.     set cName to the name of cast cc
  315.     if rollOver(sp) then
  316.       if cName = "unRolled" then
  317.         puppetSprite(sp, 1)
  318.         if sp = 11 then
  319.           puppetSound("doorSound")
  320.         else
  321.           if (sp >= 14) and (sp <= 21) then
  322.             puppetSound("tabRoll")
  323.           else
  324.             if sp = 23 then
  325.               puppetSound("note1")
  326.             else
  327.               if sp = 24 then
  328.                 puppetSound("note2")
  329.               else
  330.                 if sp = 25 then
  331.                   puppetSound("note3")
  332.                 else
  333.                   if sp = 26 then
  334.                     puppetSound("note4")
  335.                   else
  336.                     if sp = 27 then
  337.                       puppetSound("note5")
  338.                     else
  339.                       if sp = 28 then
  340.                         puppetSound("note6")
  341.                       else
  342.                         if sp = 29 then
  343.                           puppetSound("note7")
  344.                         else
  345.                           if sp = 30 then
  346.                             puppetSound("note8")
  347.                           else
  348.                             if sp = 31 then
  349.                               puppetSound("note9")
  350.                             else
  351.                               if sp = 32 then
  352.                                 puppetSound("note10")
  353.                               else
  354.                                 if (sp >= 7) and (sp <= 9) then
  355.                                   puppetSound("tabRoll")
  356.                                 else
  357.                                   puppetSound("note" & random(10))
  358.                                 end if
  359.                               end if
  360.                             end if
  361.                           end if
  362.                         end if
  363.                       end if
  364.                     end if
  365.                   end if
  366.                 end if
  367.               end if
  368.             end if
  369.           end if
  370.         end if
  371.         set the castNum of sprite sp to the castNum of sprite sp + 1
  372.       end if
  373.       next repeat
  374.     end if
  375.     puppetSprite(sp, 0)
  376.   end repeat
  377.   updateStage()
  378. end
  379.  
  380. on checkSamplesMenuRoll rolloverSpriteList
  381.   set nn to count(rolloverSpriteList)
  382.   repeat with i = 1 to nn
  383.     set sp to getAt(rolloverSpriteList, i)
  384.     set cc to the castNum of sprite sp
  385.     set cName to the name of cast cc
  386.     if rollOver(sp) then
  387.       if cName = "unRolled" then
  388.         puppetSprite(sp, 1)
  389.         if sp = 11 then
  390.           puppetSound("doorSound")
  391.         else
  392.           if (sp >= 14) and (sp <= 21) then
  393.             puppetSound("tabRoll")
  394.           else
  395.             if sp = 23 then
  396.               puppetSound("note1")
  397.             else
  398.               if sp = 24 then
  399.                 puppetSound("note2")
  400.               else
  401.                 if sp = 25 then
  402.                   puppetSound("note3")
  403.                 else
  404.                   if sp = 26 then
  405.                     puppetSound("note4")
  406.                   else
  407.                     if sp = 27 then
  408.                       puppetSound("note5")
  409.                     else
  410.                       if sp = 28 then
  411.                         puppetSound("note6")
  412.                       else
  413.                         if sp = 29 then
  414.                           puppetSound("note7")
  415.                         else
  416.                           if sp = 30 then
  417.                             puppetSound("note8")
  418.                           else
  419.                             if sp = 31 then
  420.                               puppetSound("note9")
  421.                             else
  422.                               if sp = 32 then
  423.                                 puppetSound("note10")
  424.                               else
  425.                                 if (sp >= 7) and (sp <= 9) then
  426.                                   puppetSound("tabRoll")
  427.                                 else
  428.                                   puppetSound("note" & random(10))
  429.                                 end if
  430.                               end if
  431.                             end if
  432.                           end if
  433.                         end if
  434.                       end if
  435.                     end if
  436.                   end if
  437.                 end if
  438.               end if
  439.             end if
  440.           end if
  441.         end if
  442.         set the castNum of sprite sp to the castNum of sprite sp + 1
  443.       end if
  444.       next repeat
  445.     end if
  446.     puppetSprite(sp, 0)
  447.   end repeat
  448.   updateStage()
  449. end
  450.  
  451. on checkAddonsRoll rolloverSpriteList
  452.   set nn to count(rolloverSpriteList)
  453.   repeat with i = 1 to nn
  454.     set sp to getAt(rolloverSpriteList, i)
  455.     set cc to the castNum of sprite sp
  456.     set cName to the name of cast cc
  457.     if rollOver(sp) then
  458.       if cName = "unRolled" then
  459.         puppetSprite(sp, 1)
  460.         if sp = 11 then
  461.           puppetSound("cameraClick")
  462.         else
  463.           if (sp >= 7) and (sp <= 9) then
  464.             puppetSound("tabRoll")
  465.           else
  466.             if (sp >= 14) and (sp <= 21) then
  467.               puppetSound("tabRoll")
  468.             else
  469.               puppetSound("note" & random(10))
  470.             end if
  471.           end if
  472.         end if
  473.         set the castNum of sprite sp to the castNum of sprite sp + 1
  474.       end if
  475.       next repeat
  476.     end if
  477.     puppetSprite(sp, 0)
  478.   end repeat
  479.   updateStage()
  480. end
  481.  
  482. on checkPopupRoll rolloverSprite, hiliteRectList, hiliteCastList
  483.   set sp to rolloverSprite
  484.   set hiliteSprite to rolloverSprite + 1
  485.   set cc to the castNum of sprite sp
  486.   set cName to the name of cast cc
  487.   if rollOver(sp) or rollOver(hiliteSprite) then
  488.     if cName = "unrolled" then
  489.       puppetSprite(sp, 1)
  490.       puppetSprite(hiliteSprite, 1)
  491.       puppetSound("popupRollover")
  492.       set the castNum of sprite sp to the castNum of sprite sp + 1
  493.     else
  494.       if checkRollPopupHilites(hiliteSprite, hiliteRectList, hiliteCastList) then
  495.         updateStage()
  496.       else
  497.       end if
  498.     end if
  499.   else
  500.     puppetSprite(sp, 0)
  501.     puppetSprite(hiliteSprite, 0)
  502.   end if
  503.   updateStage()
  504. end
  505.  
  506. on checkRollPopupHilites hiliteSprite, hiliteRectList, hiliteCastList
  507.   set cc to count(hiliteRectList)
  508.   set rollSprite to hiliteSprite - 1
  509.   repeat with i = 1 to cc
  510.     if mouseInRect(getAt(hiliteRectList, i)) then
  511.       set hCast to getAt(hiliteCastList, i)
  512.       if the castNum of sprite hiliteSprite <> hCast then
  513.         set the castNum of sprite hiliteSprite to hCast
  514.         set the locH of sprite hiliteSprite to the locH of sprite rollSprite
  515.         set the locV of sprite hiliteSprite to the locV of sprite rollSprite
  516.         puppetSound("popupRollover")
  517.       end if
  518.       return 1
  519.     end if
  520.   end repeat
  521.   return 0
  522. end
  523.  
  524. on hidePopup whichSprite
  525.   set cc to the castNum of sprite whichSprite
  526.   set cName to the name of cast cc
  527.   if cName = "rolled" then
  528.     set saveH to the locH of sprite (whichSprite + 1)
  529.     set the locH of sprite (whichSprite + 1) to -10000
  530.     updateStage()
  531.     scriptDelay(5)
  532.     set the locH of sprite (whichSprite + 1) to saveH
  533.     updateStage()
  534.     scriptDelay(5)
  535.     set the locH of sprite (whichSprite + 1) to -10000
  536.     updateStage()
  537.     scriptDelay(5)
  538.     set the locH of sprite (whichSprite + 1) to saveH
  539.     updateStage()
  540.     scriptDelay(5)
  541.     set the castNum of sprite whichSprite to the castNum of sprite whichSprite - 1
  542.     set the locH of sprite (whichSprite + 1) to -10000
  543.     updateStage()
  544.   end if
  545.   puppetSprite(whichSprite, 0)
  546.   puppetSprite(whichSprite + 1, 0)
  547.   updateStage()
  548. end
  549.  
  550. on mouseInRect whichRect
  551.   return (the mouseH >= the left of whichRect) and (the mouseH <= the right of whichRect) and (the mouseV >= the top of whichRect) and (the mouseV <= the bottom of whichRect)
  552. end
  553.  
  554. on popUpMenu pixelsPerRow, hiliteSprite, choiceList, menuRect
  555.   set numChoices to count(choiceList)
  556.   set sp to the clickOn
  557.   set cc to the castNum of sprite the clickOn
  558.   set hlCast to the castNum of sprite hiliteSprite
  559.   set the castNum of sprite sp to cc + 1
  560.   puppetSound("menuAppears")
  561.   updateStage()
  562.   set hilited to 1
  563.   set bNum to 0
  564.   repeat while the mouseDown
  565.     if hilited then
  566.       if (the mouseCast <> (cc + 1)) and (the mouseCast <> hlCast) then
  567.         scriptDelay(3)
  568.         if (the mouseCast <> (cc + 1)) and (the mouseCast <> hlCast) then
  569.           set the castNum of sprite sp to cc
  570.           set the rect of sprite hiliteSprite to rect(0, 0, 0, 0)
  571.           set bNum to 0
  572.           set hilited to 0
  573.           updateStage()
  574.         end if
  575.       else
  576.         set mTop to the top of menuRect
  577.         set vv to the mouseV
  578.         set dd to vv - mTop
  579.         set bNum to (dd / pixelsPerRow) + 1
  580.         if bNum <= numChoices then
  581.           set ll to the left of menuRect
  582.           set rr to the right of menuRect
  583.           set tt to mTop + (pixelsPerRow * (bNum - 1))
  584.           set bb to tt + pixelsPerRow + 1
  585.           set the rect of sprite hiliteSprite to rect(ll, tt, rr, bb)
  586.           set the blend of sprite hiliteSprite to 50
  587.         else
  588.           set bNum to 0
  589.           set the rect of sprite hiliteSprite to rect(0, 0, 0, 0)
  590.         end if
  591.         updateStage()
  592.       end if
  593.       next repeat
  594.     end if
  595.     if the mouseCast = cc then
  596.       set the castNum of sprite sp to cc + 1
  597.       set hilited to 1
  598.       updateStage()
  599.     end if
  600.   end repeat
  601.   if bNum then
  602.     puppetSound("popupSelectionMade")
  603.     set the visible of sprite hiliteSprite to 0
  604.     updateStage()
  605.     realDelay(3)
  606.     set the visible of sprite hiliteSprite to 1
  607.     updateStage()
  608.     realDelay(5)
  609.     set the visible of sprite hiliteSprite to 0
  610.     updateStage()
  611.     realDelay(3)
  612.     set the visible of sprite hiliteSprite to 1
  613.     updateStage()
  614.     realDelay(5)
  615.     set the visible of sprite hiliteSprite to 0
  616.     updateStage()
  617.     realDelay(3)
  618.     set the visible of sprite hiliteSprite to 1
  619.     updateStage()
  620.     realDelay(5)
  621.   end if
  622.   hideSprite(hiliteSprite)
  623.   set the castNum of sprite sp to cc
  624.   updateStage()
  625.   if bNum then
  626.     return getAt(choiceList, bNum)
  627.   else
  628.     return bNum
  629.   end if
  630. end
  631.  
  632. on scriptDelay x
  633.   set tt to the ticks
  634.   repeat while the ticks < (tt + x)
  635.     if the mouseDown then
  636.       repeat while the mouseDown
  637.       end repeat
  638.       exit
  639.     end if
  640.   end repeat
  641. end
  642.  
  643. on realDelay x
  644.   set the keyDownScript to "blockKeys"
  645.   set tt to the ticks
  646.   repeat while the ticks < (tt + x)
  647.   end repeat
  648.   set the keyDownScript to EMPTY
  649. end
  650.  
  651. on hideSprite whichSprite
  652.   set the locH of sprite whichSprite to -2000
  653. end
  654.